<template>
  <div>
    {{msg}}

  </div>
</template>

<script>
  import axios from 'axios'
    export default {
        name: "Longing",
      data(){

        return{
          msg:"face longing"
          }
      },
      created() {
          // console.log(window.location.href)
      var url=  window.location.href
        console.log(url.lastIndexOf("="))
        console.log(url.substring(url.lastIndexOf("=")+1))
        var name =url.substring(url.lastIndexOf("=")+1)

        // 后台-后台人脸登录接口
          axios.get("http://localhost:8100/face/login?name="+name).then(res=>{
            console.log(res.data.state)
            console.log(666)
            if (res.data.state){
              this.$router.push("/user")
            } else {
                this.msg="用户不存在，请联系管理员"
              alert("用户不存在，请联系管理员，点击返回使用密码登录")
              this.$router.push("/")
            }
          })
      }
    }
</script>

<style scoped>

</style>
